import React, { Component } from 'react';
import DemoChild1 from './Child1';
class DemoParentToChild extends Component {
  state = { 
    role: 'admin',
    username:'小舞',
    userinfo: {
      name: '唐三',
      age: 18
    }
   }
  render() { 
    return ( <>
    <h3>7.1 父传子</h3>
    {/* 子组件 */}
    <DemoChild1 username={this.state.username} role={this.state.role} userinfo={this.state.userinfo}/>
    </> );
  }
}
 
export default DemoParentToChild;